package com.cunzhang.server.mapper;

import com.cunzhang.common.enumeration.OperationType;
import com.cunzhang.pojo.entity.Employee;
import com.cunzhang.server.annotation.AutoFill;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 分页查询员工
     * @param name
     * @return
     */
    Page<Employee> pageQueryEmployee(String name);

    /**
     * 插入员工
     * @param employee
     */
    @AutoFill(OperationType.INSERT)
    void insertEmployee(Employee employee);

    /**
     * 查群员工通用方法
     * @param employee
     * @return
     */
    List<Employee> selectEmployee(Employee employee);

    /**
     * 更新员工通用方法
     * @param employee
     */
    @AutoFill(OperationType.UPDATE)
    void updateEmployee(Employee employee);
}
